<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>讨论</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">

    <!-- Tell the browser to be responsive to screen width -->
    <meta
            content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
            name="viewport">

    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/morris/morris.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/select2/select2.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-slider/slider.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/editormd/css/editormd.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/editormd/css/editormd.preview.min.css" />
</head>

<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">

    <!-- 页面头部 -->
    <jsp:include page="header.jsp"></jsp:include>
    <!-- 页面头部 /-->

    <!-- 导航侧栏 -->
    <jsp:include page="aside.jsp"></jsp:include>
    <!-- 导航侧栏 /-->

    <!-- 内容区域 -->
    <div class="content-wrapper">

        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                讨论区 <small>帖子</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="${pageContext.request.contextPath}/index.jsp"><i
                        class="fa fa-dashboard"></i> 首页</a></li>
                <li><a
                        href="${pageContext.request.contextPath}/discuss?action=findAll">讨论区</a></li>

                <li class="active">帖子</li>
            </ol>
        </section>
        <!-- 内容头部 /-->

        <!-- 正文区域 -->
        <section class="content"> <!-- .box-body -->
            <div class="box box-primary">
                <div class="box-header center-block">
                    <h3 align="center">${requestScope.discussion.name}</h3>
                    <h6 align="center">${requestScope.discussion.authorInfo.username} ${requestScope.discussion.time}</h6>
                    <br>
                    <div class="content editormd-preview-theme" id="content">
                        <textarea style="display:none;" >${requestScope.discussion.text}</textarea>
                    </div>
                </div>
                <hr style="width: 80%;margin: 0 auto;border: 0;height: 1px;background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));"/>
                <button class="btn btn-link text-right" onclick="expandDiscussion(${requestScope.discussion.id})">回复帖子</button>
                <div class="box" style="display: none" id="discussion${requestScope.discussion.id}">

                    <!-- /.box-header -->
                    <div class="box-body pad">

                        <div class="md-editor active" id="1614055366097">
                            <div class="md-header btn-toolbar">
                                <div class="btn-group">
                                    <button class="btn-default btn-sm btn" type="button" title="粗体"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdBold" data-hotkey="Ctrl+B">
                                        <span class="glyphicon glyphicon-bold"></span></button>
                                    <button class="btn-default btn-sm btn" type="button" title="斜体"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdItalic"
                                            data-hotkey="Ctrl+I"><span
                                            class="glyphicon glyphicon-italic"></span></button>
                                    <button class="btn-default btn-sm btn" type="button" title="标题"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdHeading"
                                            data-hotkey="Ctrl+H"><span
                                            class="glyphicon glyphicon-header"></span></button>
                                </div>
                                <div class="btn-group">
                                    <button class="btn-default btn-sm btn" type="button" title="链接"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdUrl" data-hotkey="Ctrl+L">
                                        <span class="glyphicon glyphicon-link"></span></button>
                                    <button class="btn-default btn-sm btn" type="button" title="图片"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdImage" data-hotkey="Ctrl+G">
                                        <span class="glyphicon glyphicon-picture"></span></button>
                                </div>
                                <div class="btn-group">
                                    <button class="btn-default btn-sm btn" type="button" title="无序列表"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdList" data-hotkey="Ctrl+U">
                                        <span class="glyphicon glyphicon-list"></span></button>
                                    <button class="btn-default btn-sm btn" type="button" title="有序列表"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdListO" data-hotkey="Ctrl+O">
                                        <span class="glyphicon glyphicon-th-list"></span></button>
                                    <button class="btn-default btn-sm btn" type="button" title="代码"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdCode" data-hotkey="Ctrl+K">
                                        <span class="glyphicon glyphicon-console"></span></button>
                                    <button class="btn-default btn-sm btn" type="button" title="引用"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdQuote" data-hotkey="Ctrl+Q">
                                        <span class="glyphicon glyphicon-comment"></span></button>
                                </div>
                                <div class="btn-group">
                                    <button class="btn-sm btn btn-primary" type="button" title="预览"
                                            tabindex="-1" data-provider="bootstrap-markdown"
                                            data-handler="bootstrap-markdown-cmdPreview"
                                            data-hotkey="Ctrl+P" data-toggle="button" aria-pressed="false">
                                        <span class="glyphicon glyphicon-search"></span> 预览
                                    </button>
                                </div>
                                <div class="md-controls"><a class="md-control md-control-fullscreen"
                                                            href="#"><span
                                        class="glyphicon glyphicon-fullscreen"></span></a></div>
                            </div>

                                        <textarea id="markdown-textarea" name="text"
                                                  style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid rgb(221, 221, 221); padding: 10px; resize: none; display: block;"
                                                  class="md-input textareaDiscussion" rows="5"></textarea>
                            <div class="md-fullscreen-controls"><a href="#" class="exit-fullscreen"
                                                                   title="Exit fullscreen"><span
                                    class="glyphicon glyphicon-fullscreen"></span></a></div>
                        </div>

                    </div>
                    <div class="box-tools text-right">
                        <button type="submit" class="btn bg-maroon" onclick="submitDiscussion(1)">提交</button>
                    </div>

                </div>


                <hr style="width: 80%;margin: 0 auto;border: 0;height: 1px;background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));"/>

                <div class="box-body">




                    <!-- 数据表格 -->
                    <div class="table-box">
                        <c:forEach items="${requestScope.page.bigList}" var="discuss" varStatus="num">

                        <div style="width :85%">


                            <div style="display: inline-block;width: 70px" >
                                <img
                                src="${pageContext.request.contextPath}/img/user2-160x160.jpg"
                                class="img-circle" alt="User Image" style="width: 70px;height: 70px">
                                <p style="margin-left: 20px"> ${discuss.authorInfo.username}</p>
                            </div>
                            <c:if test="${not empty discuss.replyDiscuss}">

                            <div style="width :85%;display: inline-block;
                            float: right;
                             margin-right: 80px;
                             margin-top: 8px;
                             border:1px solid #a0a0a0" >
                                <p style="color: #655f5c">回复  ${discuss.replyDiscuss.authorInfo.username}</p>
                                <p>${discuss.replyDiscuss.text}</p>
                            </div>
                            </c:if>

                            <div style="width :85%;display: inline-block;
                            float: right;
                             margin-right: 80px;
                             margin-top: 8px;" >
                                <p>${discuss.text}</p></div>


                            <div style="margin-left: 83%;margin-top: -20px;">
                                <button id="thumbUp" class="btn btn-link" isClick="false" discussId="${discuss.id}" onclick="thumbUp(this)"><i  class="glyphicon glyphicon-thumbs-up" >${discuss.thumbsUp}</i></button>
                                <button class="btn btn-link" onclick="expand(${discuss.id})">回复</button>
                                ${num.count+requestScope.page.countPerpage*(requestScope.page.curentPageIndex-1)}楼
                            </div>
                        </div>
                            <div class="box" style="display: none" id="${discuss.id}">

                                <!-- /.box-header -->
                                <div class="box-body pad">

                                    <div class="md-editor active" id="1614055366097">
                                        <div class="md-header btn-toolbar">
                                            <div class="btn-group">
                                                <button class="btn-default btn-sm btn" type="button" title="粗体"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdBold" data-hotkey="Ctrl+B">
                                                    <span class="glyphicon glyphicon-bold"></span></button>
                                                <button class="btn-default btn-sm btn" type="button" title="斜体"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdItalic"
                                                        data-hotkey="Ctrl+I"><span
                                                        class="glyphicon glyphicon-italic"></span></button>
                                                <button class="btn-default btn-sm btn" type="button" title="标题"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdHeading"
                                                        data-hotkey="Ctrl+H"><span
                                                        class="glyphicon glyphicon-header"></span></button>
                                            </div>
                                            <div class="btn-group">
                                                <button class="btn-default btn-sm btn" type="button" title="链接"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdUrl" data-hotkey="Ctrl+L">
                                                    <span class="glyphicon glyphicon-link"></span></button>
                                                <button class="btn-default btn-sm btn" type="button" title="图片"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdImage" data-hotkey="Ctrl+G">
                                                    <span class="glyphicon glyphicon-picture"></span></button>
                                            </div>
                                            <div class="btn-group">
                                                <button class="btn-default btn-sm btn" type="button" title="无序列表"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdList" data-hotkey="Ctrl+U">
                                                    <span class="glyphicon glyphicon-list"></span></button>
                                                <button class="btn-default btn-sm btn" type="button" title="有序列表"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdListO" data-hotkey="Ctrl+O">
                                                    <span class="glyphicon glyphicon-th-list"></span></button>
                                                <button class="btn-default btn-sm btn" type="button" title="代码"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdCode" data-hotkey="Ctrl+K">
                                                    <span class="glyphicon glyphicon-console"></span></button>
                                                <button class="btn-default btn-sm btn" type="button" title="引用"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdQuote" data-hotkey="Ctrl+Q">
                                                    <span class="glyphicon glyphicon-comment"></span></button>
                                            </div>
                                            <div class="btn-group">
                                                <button class="btn-sm btn btn-primary" type="button" title="预览"
                                                        tabindex="-1" data-provider="bootstrap-markdown"
                                                        data-handler="bootstrap-markdown-cmdPreview"
                                                        data-hotkey="Ctrl+P" data-toggle="button" aria-pressed="false">
                                                    <span class="glyphicon glyphicon-search"></span> 预览
                                                </button>
                                            </div>
                                            <div class="md-controls"><a class="md-control md-control-fullscreen"
                                                                        href="#"><span
                                                    class="glyphicon glyphicon-fullscreen"></span></a></div>
                                        </div>
                                        <div id="textarea${discuss.id}">
                                        <textarea id="markdown-textarea" name="text"
                                                  style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid rgb(221, 221, 221); padding: 10px; resize: none; display: block;"
                                                  class="md-input textarea${discuss.id}" rows="5"></textarea></div>
                                        <div class="md-fullscreen-controls"><a href="#" class="exit-fullscreen"
                                                                               title="Exit fullscreen"><span
                                                class="glyphicon glyphicon-fullscreen"></span></a></div>
                                    </div>

                                </div>
                                <div class="box-tools text-right">
                                    <button type="submit" class="btn bg-maroon" onclick="submitDiscuss(1,${discuss.id})">提交</button>
                                </div>

                            </div>

                            <hr/>
                        </c:forEach>


                    </div>
                    <!-- 数据表格 /-->

                </div>
                <!-- /.box-body -->

                <!-- .box-footer-->
                <div class="box-footer">
                    <div class="pull-left">
                        <div class="form-group form-inline">
                            总共${requestScope.page.pageCount} 页，共${requestScope.page.recordCount}条数据。 每页 <select class="form-control" id="fenYe" onchange="fenYe()">
                            <option>4</option>
                            <option>5</option>
                            <option>8</option>
                            <option>10</option>
                            <option>20</option>
                        </select> 条
                        </div>
                    </div>

                    <div class="box-tools pull-right">
                        <ul class="pagination">
                            <li><a href="${pageContext.request.contextPath}/discuss?action=findDiscussionById&page=1&size=${requestScope.page.countPerpage}&id=${requestScope.discussion.id}" aria-label="Previous">首页</a></li>
                            <li><a href="${pageContext.request.contextPath}/discuss?action=findDiscussionById&page=${requestScope.page.curentPageIndex-1}&size=${requestScope.page.countPerpage}&id=${requestScope.discussion.id}">上一页</a></li>
                            <%--							<c:forEach begin="1" end="${sysLogs.pages}" var="pageNum">--%>
                            <%--								<li><a href="${pageContext.request.contextPath}/sysLog/findAll.do?page=${pageNum}&size=${sysLogs.pageSize}&fuzzyName=${fuzzyName}">${pageNum}</a></li>--%>
                            <%--							</c:forEach>--%>
                            <c:if test="${requestScope.page.curentPageIndex<requestScope.page.pageCount}">
                            <li><a href="${pageContext.request.contextPath}/discuss?action=findDiscussionById&page=${requestScope.page.curentPageIndex+1}&size=${requestScope.page.countPerpage}&id=${requestScope.discussion.id}">下一页</a></li>
                            </c:if>
                            <li><a href="${pageContext.request.contextPath}/discuss?action=findDiscussionById&page=${requestScope.page.pageCount}&size=${requestScope.page.countPerpage}&id=${requestScope.discussion.id}" aria-label="Next">尾页</a></li>
                        </ul>
                    </div>

                </div>
                <!-- /.box-footer-->

            </div>

        </section>
        <!-- 正文区域 /-->

    </div>
    <!-- 内容区域 /-->



</div>

<script
        src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/raphael/raphael-min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/morris/morris.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/sparkline/jquery.sparkline.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/knob/jquery.knob.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/daterangepicker/moment.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/datepicker/bootstrap-datepicker.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/fastclick/fastclick.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/iCheck/icheck.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/adminLTE/js/app.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/select2/select2.full.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/markdown.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/ckeditor/ckeditor.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/datatables/jquery.dataTables.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/chartjs/Chart.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.resize.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.pie.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.categories.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script
        src="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>

<script src="${pageContext.request.contextPath}/editormd/editormd.js"></script>
<script src="${pageContext.request.contextPath}/editormd/lib/marked.min.js"></script>
<script src="${pageContext.request.contextPath}/editormd/lib/prettify.min.js"></script>
<script src="${pageContext.request.contextPath}/editormd/examples/js/jquery.min.js"></script>

<script>


    <%--$(function () {--%>


    <%--    $("#thumbUp").click(function(){--%>
    <%--        var isClick= $("#thumbUp").attr("isClick");--%>
    <%--        var num=$("#thumbUp").children().text();--%>
    <%--        if(isClick=="false"){--%>
    <%--            $("#thumbUp").children().text(Number(num)+1);--%>
    <%--            document.getElementById('thumbUp').style.color="red"--%>
    <%--            $("#thumbUp").attr("isClick","true");--%>

    <%--            &lt;%&ndash;$.ajax({&ndash;%&gt;--%>
    <%--            &lt;%&ndash;    url:"${pageContext.request.contextPath}/discuss?action=thumbUp&id="+$("#thumbUp").attr("discussId")&ndash;%&gt;--%>
    <%--            &lt;%&ndash;});&ndash;%&gt;--%>



    <%--        }else {--%>
    <%--            $("#thumbUp").children().text(Number(num)-1);--%>
    <%--            document.getElementById('thumbUp').style.color="black";--%>
    <%--            $("#thumbUp").attr("isClick","false");--%>
    <%--        }--%>


    <%--    });--%>
    <%--});--%>
    function submitDiscuss(userId,discussId) {

        var obj=document.getElementsByClassName("textarea"+discussId)[0];


        $.ajax({
            url:"${pageContext.request.contextPath}/discuss?action=insertDiscuss&author="+userId+"&discussId="+discussId+"&text="+obj.value+"&discussionId="+${requestScope.discussion.id}
        });
        alert("评论成功");
    }
    function submitDiscussion(userId) {

        var obj=document.getElementsByClassName("textareaDiscussion")[0];


        $.ajax({
            url:"${pageContext.request.contextPath}/discuss?action=insertDiscuss&author="+userId+"&text="+obj.value+"&discussionId="+${requestScope.discussion.id}
        });
        alert("评论成功");
    }
    function expandDiscussion(t) {
        var obj=document.getElementById("discussion"+t);
        if(obj.style.display==""){
            obj.style.display = "none";
        }else{
            obj.style.display = "";
        }
    }
    function expand(t) {
        var obj=document.getElementById(t);
        if(obj.style.display==""){
            obj.style.display = "none";
        }else{
            obj.style.display = "";
        }
    }

    function thumbUp(t){
        var isClick= t.getAttribute("isClick");
        var num=t.firstChild.innerText;

        if(isClick=="false"){
            t.firstChild.innerText=Number(num)+1;
            t.style.color="red";
            t.setAttribute("isClick","true");

            $.ajax({
                url:"${pageContext.request.contextPath}/discuss?action=thumbUp&fun=t&id="+t.getAttribute("discussId")
            });

        }else {
            t.firstChild.innerText=Number(num)-1;
            t.style.color="black";
            t.setAttribute("isClick","false");
            $.ajax({
                url:"${pageContext.request.contextPath}/discuss?action=thumbUp&fun=f&id="+t.getAttribute("discussId")
            });
        }

    }
    //分条数显示
    function fenYe(){
        var pageSize=$("#fenYe").val();
        location.href="${pageContext.request.contextPath}/sysLog?action=findAll&page=1&size="+pageSize;
    }
    $(document).ready(function() {
        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale : 'zh-CN'
        });
    });


    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }

    $(document).ready(function() {

        // 激活导航位置
        setSidebarActive("order-manage");

        // 列表按钮
        $("#dataList td input[type='checkbox']").iCheck({
            checkboxClass : 'icheckbox_square-blue',
            increaseArea : '20%'
        });
        // 全选操作
        $("#selall").click(function() {
            var clicks = $(this).is(':checked');
            if (!clicks) {
                $("#dataList td input[type='checkbox']").iCheck("uncheck");
            } else {
                $("#dataList td input[type='checkbox']").iCheck("check");
            }
            $(this).data("clicks", !clicks);
        });
    });
    editormd.markdownToHTML("content",{emoji:true});
</script>
</body>

</html>
